package com.sdjz.club.club.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sdjz.club.club.entity.Organization;
import com.sdjz.club.club.entity.UserOrganization;
import com.sdjz.club.club.mapper.OrganizationMapper;
import com.sdjz.club.club.mapper.UserOrganizationMapper;
import com.sdjz.club.club.service.OrganizationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Dftre
 * @since 2022-07-15
 */
@Service
public class OrganizationServiceImp extends ServiceImpl<OrganizationMapper, Organization> implements OrganizationService {
    @Autowired
    UserOrganizationMapper userOrganizationMapper;


    public Boolean delete(String id){
        userOrganizationMapper.delete(
                new QueryWrapper<UserOrganization>()
                        .eq("organization_id",id)
        );
        this.removeById(id);
        return true;
    };
}
